package main

import (
	"crawler/concurrent_crawler/frontend/controller"
	"net/http"
)

func main() {
	//stat, err2 := os.Stat("concurrent_crawler/frontend/view/template.html")
	//fmt.Println(stat, err2)
	http.Handle("/", http.FileServer(http.Dir("concurrent_crawler/frontend/view")))
	http.Handle("/search",
		controller.CreateSearchResultHandler("concurrent_crawler/frontend/view/template.html"))
	err := http.ListenAndServe(":8888", nil)
	if err != nil {
		panic(err)
	}
}
